package com.guang.springbootrequestversion.controller;

import com.guang.springbootrequestversion.bean.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author liguang
 * @date 2022/5/12 13:48
 */
@RestController
@RequestMapping(path = "log")
public class LoggerController {


    /**
     * 这里的消息转换器原来是这么来进行使用的！
     * @param userName
     * @return
     */
    @GetMapping("/user")
    public User getuser(@RequestParam(name = "lig",required = false,defaultValue = "hello") String userName){
        User user = new User();
        user.setUsername(userName);
        user.setBirthday(new Date());
        return user;
    }
}
